#ifndef __GM_H__
#define __GM_H__

#include "includes.h"
#include "vehicle.h"
#include "drivers.h"

typedef struct __GmPidMap {
    uint8_t id;
    uint8_t cmd[2];
    uint8_t service_id;
    uint8_t offset;
    uint8_t size;
    uint8_t support;
} GmPidMap;

void gm_init(Vehicle *vehicle);

void gm_control_window(uint8_t state);
void gm_control_door(uint8_t state);
void gm_control_light(uint8_t state);
void gm_control_sunroof(uint8_t state);
void gm_control_trunk(uint8_t state);
void gm_control_findcar(uint8_t state);

void gm_get_rpm(uint16_t *rpm);
uint8_t gm_check_engine_on(void);
void gm_process_eng_data(EngineDataMap *dataMap);
void gm_process_bcm_data(BcmDataMap *dataMap);
uint8_t gm_keepalive(uint16_t tx_id, uint16_t rx_id);
void gm_get_fault_code(uint8_t type, FaultCodeItem *item);

#endif
